package com.tian.mall;

import java.util.Arrays;

/**
 * @author zhumengping
 * @title: ChannelEnums
 * @projectName zhump-cloud
 * @date 2023/8/2 11:54
 */
public enum ChannelEnums {


    /**登录注册*/
    LOGIN_REGISTER("login_register","此邮件为注册邮件"),

    /**订单确认*/
    ORDER_CONFIRM("order_confirm","此邮件为订单确认邮件")
    ;

    private String channel;

    private String desc;

    ChannelEnums(String channel, String desc) {
        this.channel = channel;
        this.desc = desc;
    }

    public String getChannel() {
        return channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static ChannelEnums getInstance(String channel){
        return Arrays.stream(ChannelEnums.values()).filter(o->o.getChannel().equals(channel)).findFirst().orElse(null);
    }
}
